<template>
    <div>
        <!-- 首页 -->
        <!-- 三级联动全局组件：三级联动已经注册为全局组件，所以不需要引入 -->
        
       <TypeNav />
        <ListContainer />
        <Recommend />
        <Rank />
        <Like />
         <Floor v-for="(floor,index) in floorList" :key="floor.id" :list="floor" />
        <Brand />
    </div>
</template>

<script>
import ListContainer from '@/views/Home/ListContainer/ListContainer.vue';
import Recommend from '@/views/Home/Recommend/Recommend.vue';
import Rank from '@/views/Home/Rank/Rank.vue';
import Like from '@/views/Home/Like/Like.vue';
import Floor from "@/views/Home/Floor/Floor.vue";
import Brand from '@/views/Home/Brand/Brand.vue';

import {mapState} from 'vuex'

export default {
   name:'',
   components:{
       ListContainer,
       Recommend,
       Rank,
       Like,
       Floor,
       Brand
   },

    mounted() {
        // 派发action，获取floor组件的数据
        this.$store.dispatch('getFloorList')
    },
    computed:{
        ...mapState({
            floorList:(state)=>state.home.floorList
        })
    }
};
</script>

<style>

</style>